<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全国医院排行榜</title>
    <meta id="viewport" name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,minimal-ui" />
    <meta content="yes" name="apple-touch-fullscreen"/>
    <meta name="”apple-mobile-web-app-capable”" content="”yes”">
    <meta name="App-Config" content="fullscreen=yes,useHistoryState=yes,transition=yes"/>
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="./static/css/index.min.css" media="screen" charset="utf-8">
    <meta name="keywords" content="医院排名，医院等级，医院查询，大医院，好医院，癌症，肿瘤" />
    <meta name="description" content="全国医院排行榜提供全国各省、市医院查询功能，按医院等级排名，方便您快速的找到最适合的医院进行就诊咨询。" />
    <script>
    // 统计
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?ac3e5ff19c07de09c348fee52d9bd084";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
  </script>

</head>
<body class="m pc">
<script type="text/javascript">
// 判断屏幕宽度
function getStyle(obj, attr){
 if(obj.currentStyle){
  return obj.currentStyle[attr];
 }else{
  return getComputedStyle(obj, false)[attr];
 }
};
!function(){
  var bw = document.querySelector('body'),
      bw = getStyle(bw,'width'),
      bw = parseInt(bw);
  if(bw<1000){
    !function(e,t){var n=e.documentElement,i="orientationchange"in window?"orientationchange":"resize",d=(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,function(){var t=n.clientWidth;t&&(t>=750?(t=750,e.body.style.width="750px"):e.body.style.width=t+"px",n.style.fontSize=100*(t/750)+"px",n.dataset.width=t,n.dataset.percent=100*(t/750))});d(),e.documentElement.classList.add("iosx"+t.devicePixelRatio),e.addEventListener&&t.addEventListener(i,d,!1)}(document,window)
  }
}();
</script>
<div class="mask">
  <div class="wpr"></div>
</div>
  <div class="banner">
    <div class="p-c pc">
      <div class="f-l">
        2017全国医院排行榜
      </div>
      <div class="f-r">
        复旦大学医疗管理研究所权威认证
      </div>
    </div>
    <div class="p-c m">
      <img src="./static/img/banner.jpg" width="100%" alt="" />
    </div>
  </div>

  <div class="select p-c p-r">
    <div class="type clearfix">
      <div class="f-l">
        医院类型
      </div>
      <div class="f-r">
        <div class="sec"><em>全部</em></div>
        <div class="clear"> </div>
        <div class="wpr clearfix">
        </div>
      </div>
    </div>
    <div class="address clearfix">
      <div class="f-l">
        地区
      </div>
      <div class="f-r p-r area">
        <div data-toggle="distpicker" id="distpicker">
          <select class="province" onchange="_hmt.push(['_trackEvent', 'select-省区', 'select', '省','xxx省'])">
            <option>全国</option>
          </select>
          <!-- <select class="city" onchange="_hmt.push(['_trackEvent', 'select-市区', 'select', '市','xxx市'])">
            <option>全部</option>
          </select> -->
        </div>
      </div>
    </div>
  </div>
    <div class="newselect m p-c">
      <div class="linea"><var></var></div>
      <div class="lineb"><var></var></div>
      <div class="wpr flex">
        <div class="zh active">
          <span>综合排行</span>
          <small>comprehensive ranking</small>
        </div>
        <div class="kes">
          <span>科室排行</span>
          <small>Ranking department</small>
        </div>
      </div>
    </div>



  <div class="kstit p-c">
    <div class="wpr clearfix">
      <div class="left">
        病理科
      </div>
      <div class="right">
        <img src="./static/img/menu.png" style="width:.28rem" alt="" />选择科室
      </div>
    </div>
  </div>

  <div class="sort p-c">
    <!-- <h4 class="tit">医院TOP排行</h4> -->
    <div class="wpr clearfix">
      <!-- <div class="item">
        <div class="top f-l">
          <var>top<big>1</big></var>
        </div>
        <div class="img f-l" style="background-image:url(https://dummyimage.com/750x480/b293a4/fff&text=someImg)"></div>
        <div class="info f-l">
          <h5>中国人民解放军总医院301医院<small>三级甲等</small></h5>
          <em>地址：北京市海淀区复兴路28号</em>
        </div>
      </div>
    -->
    </div>
    <!-- <a href="javascript:void(0)" class="more js-load-more">点击查看更多</a> -->
  </div>

  <div class="remarks p-c">
    <div class="wpr  bg-f">
      备注: 1 综合排行是按医院各个科室的专科声誉与科研学术的综合评分而排行； 2 科室排行是按医院的单个科室的评分而排行
    </div>
  </div>
<div class="footer">
  <div class="p-c pc">
    京B2-20130007   京卫(03)网审[2014]015号   (京)-经营性-2014-0022
  </div>
  <div class="m">
    <img src="./static/img/bot.png" width="100%" alt="" />
  </div>
</div>
</body>
<script type="text/javascript" src="./static/js/jq.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="./static/js/wx_share_common.js"></script>
<!-- <script type="text/javascript" src="./static/js/distpicker.data.js"></script> -->
<!-- <script src='./static/js/distpicker.js'></script> -->
<script type="text/javascript">


var ks_index = 0;
$(function(){
  var items = $('.newselect .wpr div');
  items.on('click',function(){
    let _this = $(this);
    if(_this.hasClass('active'))return;
    if(_this.index()){
      $('.kstit').slideDown()
      $('.sort .wpr').addClass('ksort')
      getks({num:ks_index});
    }else{
      $('.kstit').slideUp()

      getData({'page':1},true);
    }
    items.removeClass('active');
    // $(this).delay(2000).addClass('active')
    setTimeout(function(){
      _this.addClass('active')
    },180)
  })

})

function getks(obj){
  $.ajax({
      type: 'get',
      url: '../sort.json',
      dataType: 'json',
      data:obj,
      success: function(reponse){
        var _data = reponse.data;
            thisIndex = obj.num,
            data = _data[thisIndex].hospital
            result = '';
            console.log(data);
        $('.sort .wpr').empty();

        for(var i=0; i< 10; i++){
            result += '<a href="javascript:void(0)" class="item">' +
                      '<div class="top f-l">' +
                        '<var>top<big>' + data[i].no + '</big></var>' +
                      '</div>' +
                      '<div class="info f-l">' +
                        '<h5><span>' + data[i].name + '</span><small>综合评分 <var>' + data[i].score + '</var></small></h5>' +
                      '</div>' +
                    '</a>'
          }
          $('.sort .wpr').append(result)


      }
    })
}
// http://api.zygvip.com/hospital_rank/
// img.zygvip.com
var  dataUrl = 'http://test.api.zygvip.com/',
    imgUrl = 'http://img.zygvip.com/';

//  获取检测医院类型
function checkType(){
  var bw = document.querySelector('body'),
      bw = getStyle(bw,'width'),
      bw = parseInt(bw);
  if(bw<1000){
    $(function(){
      var spas = $('.mask .wpr span,.select .type .f-r span'),
          wpr = $('.select .type .wpr'),
          sec = $('.kstit .left'),
          mask = $('.mask'),
          kes_me = $('.kstit .right');
      spas.on('click',function(){
        spas.removeClass('active');
        $(this).addClass('active');
        mask.hide()
        wpr.hide()
        sec.text($(this).text());

        ajaxType($(this).attr('data-typeId'));
      })
      sec.click(function(){
        mask.show()
        wpr.fadeIn()
      })
      kes_me.click(function(){
          mask.show()
          wpr.fadeIn()
      })
      mask.click(function(e){
        e.stopPropagation();
        mask.hide()
        wpr.hide()
      })
    })
  }else{
    var spas = $('.mask .wpr span');
    $('mask').on('click','span',function(){
      spas.removeClass('active');
      $(this).addClass('active');
      ajaxType($(this).attr('data-typeId'));
    })
  }

  function ajaxType(num){
    ks_index = num;
    getks({num:num},true)
  }
};

// 获取医院列表
$(function(){
	/*初始化*/
	var counter = 1; /*计数器*/

	/*首次加载*/
	getData({'page':counter},true);

	/*监听加载更多*/
  $('.js-load-more').on('click', function(){
      counter ++;
      getData({'page':counter},false);
  });

  // 医院类型
  getType();

});
function getType(){
  var wpr = $('.mask .wpr,.select .f-r .wpr'),
      // result = '<span class="active"  onclick=' + "_hmt.push(['_trackEvent','span-医院类型','click','医院类型选择'])" + ' data-typeId ="0" >' + '全部' + '</span>';
      result = '';
  $.ajax({
			type: 'get',
			url: '../sort.json',
			dataType: 'json',
			success:function(reponse){
          var data = reponse.depart;
          for(var i=0; i< data.length; i++){
							result += '<span  onclick=' + "_hmt.push(['_trackEvent','span-医院类型','click','医院类型选择'])" + ' data-typeId = ' + i + '>' + data[i] + '</span>'
					  }

					wpr.empty().append(result);

			},
      complete:function(){
        checkType()
      }
    })
};
var obj = {'is_page':true,'page':1,'per_page':10};

// 获取省
function getProvince(num){
  var obj;if(!!num){obj={"parent_id":num}}else{obj={"parent_id":0}}
  $.ajax({
      type: 'get',
      url: dataUrl + 'hospital_rank/area',
      dataType: 'json',
      data:obj,
      success: function(reponse){
        if(reponse.code == 200){
          var data = reponse.data;
          if(!!num){
            var result = "<option data-areaId='0'>全部</option>";
            for(var i=0; i< data.length; i++){
  							result += '<option data-areaId=' + data[i].areaId + '>' + data[i].areaName + '</option>'
  					  }
              $('.city').empty().append(result)
              return false;
          }else{
            var result = "<option data-areaId='0'>全国</option>";
            for(var i=0; i< data.length; i++){
  							result += '<option data-areaId=' + data[i].areaId + '>' + data[i].areaName + '</option>'
  					  }
              $('.province').empty().append(result)
              $('.city').empty().append("<option data-areaId=''>全部</option>")
          }
        }
      }
    })
};

$('.province').on('change',function(){
  obj.page = 1;
  var areaId = $(this).find("option:selected").attr('data-areaId')
  getData({'p_id':areaId,c_id:""},true)
  getProvince(areaId);

});
$('.city').on('change',function(){
  obj.page = 1;
  var areaId = $(this).find("option:selected").attr('data-areaId')
  getData({'c_id':areaId},true)

});
function getCity(){
  $.ajax({
      type: 'get',
      url: dataUrl + 'hospital_rank/area',
      dataType: 'json',
      success: function(reponse){
        if(reponse.code == 200){
          var data = reponse.data;

          var result = "<option data-areaId=''>全国</option>";

          for(var i=0; i< data.length; i++){
							result += '<option data-areaId=' + data[i].areaId + '>' + data[i].areaName + '</option>'
					  }
            $('.province').empty().append(result)
        }

      }
    })
};
getProvince();

function getData(obja,statue){
      obj = $.extend({},obj,obja)
      console.log(obj);
  var getmoreBtn = $(".js-load-more"),
      countain = $('.sort .wpr'),
      top = $('.sort .wpr .top big');
	$.ajax({
			type: 'get',
			url: dataUrl + 'hospital_rank/hospital',
			dataType: 'json',
			data:obj,
			beforeSend:function(){

				isEnd =false;
				getmoreBtn.text('加载中...');
			},
			success: function(reponse){

					var data = reponse.data.list;
					var sum = reponse.data.list.length;
					var result = '';

					if(data.length == 0 ){
							getmoreBtn.text('没有更多了...');
					}else{
						getmoreBtn.text('点击查看更多');
					}

					for(var i=0; i< sum; i++){
            console.log(!!data[i].hospitalUrl);
							result += '<a onclick=' + "_hmt.push(['_trackEvent','span-医院列表','click','医院名称','" + data[i].hospitalName + "'])" + ' href=' + (!!data[i].hospitalUrl?data[i].hospitalUrl:"javascript:void(0)") + ' target="blank" class="item">' +
                        '<div class="top f-l">' +
                          '<var>top<big>' + 1 + '</big></var>' +
                        '</div>' +
                        '<div class="img f-l" style="background-image:url(' + imgUrl + data[i].hospitalImg + ')"></div>' +
                        '<div class="info f-l">' +
                          '<h5><span>' + data[i].hospitalName + '</span><small>' + data[i].hospitalLevel + '</small></h5>' +
                          '<em>'+ data[i].hospitalAddress + '</em>' +
                        '</div>' +
                      '</a>'
					  }

            if(statue){
              countain.empty().html(result);
            }else{
              countain.append(result);
            }


			},
			error: function(xhr, type){
					console.log('Ajax error!');
			},
			complete:function(){
        $('.sort .wpr').removeClass('ksort')
        $('.sort .wpr big').each(function(index,item){
          $(this).text(index+1)
        })
			}
	});
};


</script>
</html>
